package com.wallet.admin.feign.system;

import com.wallet.common.vo.PageResult;
import com.wallet.provider.model.Menu;
import com.wallet.provider.model.vo.TreeNodeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("wallet-provider-sys")
public interface MenuFeignClient {

    /**
     * 分页查询系统菜单
     * @param pageNum
     * @param pageSize
     * @param order
     * @param ordername
     * @return
     */
    @RequestMapping(value = "/getMenuList", method = RequestMethod.GET)
    PageResult<Menu> getMenuList(@PathVariable("pageNum") int pageNum, @PathVariable("pageSize") int pageSize, @PathVariable("order") String order,@PathVariable("ordername") String ordername);

    /**
     * 获取菜单树
     * @return
     */
    @RequestMapping(value = "/getMenuTree", method = RequestMethod.GET)
    List<TreeNodeVo> getMenuTree();
    /**
     * 获取菜单树
     * @return
     */
    @RequestMapping(value = "/getMenuTree", method = RequestMethod.GET)
    List<TreeNodeVo> getMenuTree(Long roleId);

    /**
     * 根据id查询菜单
     * @param id
     * @return
     */
    @RequestMapping(value = "/getMenuById", method = RequestMethod.GET)
    public Menu getMenuById(@RequestParam("id") Long id);

    /**
     * 更新菜单
     * @param menu
     * @return
     */
    @RequestMapping(value = "/updateMenu", method = RequestMethod.GET)
    public boolean updateMenu(Menu menu);

    /**
     * 删除菜单
     * @param ids
     * @return
     */
    @RequestMapping(value = "/deleteMenu", method = RequestMethod.GET)
    public Boolean deleteMenu(Long[] ids);
}
